<template>
  <div class="flex justify-center items-center">
    <h3 class="text-2xl font-bold mb-4">{{ $t("aboutSettle.settle") }}</h3>
  </div>
  <div class="settleMain">
    <img src="@/assets/images/aboutSettle/hand.png" alt="" class="hand" />
    <div
      v-for="(item, index) of list"
      :key="index"
      class="flex justify-start items-center"
      :class="'item' + (index + 1)"
    >
      <img :src="getImgUrl(item.imgUrl)" alt="" class="iconImg" />
      <div class="textBox mr-10 ml-10">
        <h3>{{ item.title }}</h3>
        <p>{{ item.text }}</p>
      </div>
    </div>
  </div>
</template>
<script setup>
import { computed } from "vue";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
const list = computed(() => {
  return [
    {
      title: t("aboutSettle.globalCurrency"),
      text: t("aboutSettle.globalCurrencyTip"),
      imgUrl: "../../../assets/images/aboutSettle/1.png",
    },
    {
      title: t("aboutSettle.CompetitivePricing"),
      text: t("aboutSettle.CompetitivePricingTip"),
      imgUrl: "../../../assets/images/aboutSettle/2.png",
    },
    {
      title: t("aboutSettle.Professional"),
      text: t("aboutSettle.ProfessionalTip"),
      imgUrl: "../../../assets/images/aboutSettle/3.png",
    },
    {
      title: t("aboutSettle.FundSecurity"),
      text: t("aboutSettle.FundSecurityTip"),
      imgUrl: "../../../assets/images/aboutSettle/4.png",
    },
  ];
});

const getImgUrl = (url) => {
  return new URL(url, import.meta.url).href;
};
</script>
<style lang="scss" scoped>
.settleMain {
  background: #fff;
  min-height: 500px;
  margin-bottom: 40px;
  background: url("@/assets/images/aboutSettle/line.png");
  background-repeat: no-repeat;
  background-size: 44% 80% cover;
  background-position: center;
  position: relative;
  .hand {
    width: 180px;
    height: 180px;
    position: absolute;
    top: 32%;
    left: 50%;
    transform: translateX(-50%);
  }
  .iconImg {
    width: 50px;
    height: 50px;
  }
  .textBox {
    background: #f3f6fd;
    padding: 10px;
    border-radius: 15px;
    h3 {
      font-weight: 500;
      margin-bottom: 2%;
    }
    p {
      max-width: 350px;
      font-size: 14px;
      color: #636363;
    }
  }
  .item1 {
    position: absolute;
    top: 18%;
    left: 21%;
    transform: translateX(-50%);
    flex-direction: row-reverse;
    text-align: right;
  }
  .item2 {
    position: absolute;
    top: 10%;
    left: 59%;
  }
  .item3 {
    position: absolute;
    top: 60%;
    left: 59%;
  }
  .item4 {
    position: absolute;
    top: 60%;
    left: 17%;
    transform: translateX(-50%);
    flex-direction: row-reverse;
  }
}
</style>
